﻿
#r "System.Windows.Forms.DataVisualization.dll"

open System
open System.Windows.Forms
open System.Windows.Forms.DataVisualization.Charting

let chart = new Chart(Dock = DockStyle.Fill)
chart.Titles.Add(new Title("Simple Column Chart"))

let area = new ChartArea("main")
chart.ChartAreas.Add(area)

let mainForm = new Form(Visible = true,TopMost =true, Height = 500, Width = 700)
mainForm.Controls.Add chart 

let values = [
    let rnd = new Random()
    for index = 1 to 10 do
        yield rnd.NextDouble() * 100.0
]

let column = new Series("column",IsValueShownAsLabel = true)
column.["PointWidth"] <- "0.4"
column.["DrawingStyle"] <- "LightToDark"
chart.Series.Add column

let curve = new Series("curve",ChartType = SeriesChartType.Line,BorderWidth = 6)
chart.Series.Add curve

// ------------ insert values into series
values |> List.iter (fun value ->
                        column.Points.Add value |> ignore
                        curve.Points.Add value |> ignore
)



